package com.project.running.web.Servlet;

import com.project.running.Service.Impl.pwdMissServiceImpl;
import com.project.running.Service.pwdMissService;
import com.project.running.bean.Memberinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/10/6-10-06-21:42
 * @Description：com.project.running.web.Servlet
 */
@WebServlet("/PasswdMissing")
@Controller
public class PasswdMissing extends HttpServlet {
    @Autowired
    pwdMissService service;
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setCharacterEncoding("utf-8");
        String userName = req.getParameter("userName");
        String question = req.getParameter("passwdQuestion");
        String answer = req.getParameter("passwdAnswer");

        Memberinfo member = service.makingNewPwd(userName, question, answer);
    }
}
